<?php

use EasySwoole\DDL\DDLBuilder;
use EasySwoole\DDL\Blueprint\Table;
use EasySwoole\DDL\Enum\Engine;
use EasySwoole\DDL\Enum\Character;

//会员列表
return $result = DDLBuilder::table('admins', function (Table $table)
{
    $table->setIfNotExists()->setTableComment('管理员表')//设置表名称/
    ->setTableEngine(Engine::INNODB)//设置表引擎
    ->setTableCharset(Character::UTF8MB4_GENERAL_CI);//设置表字符集
    $table->colInt('admin_id', 10)->setColumnComment('ID')->setIsAutoIncrement()->setIsPrimaryKey();
    $table->colVarChar('admin_name')->setColumnLimit(200)->setDefaultValue('')->setColumnComment('管理员账户');
    $table->colVarChar('password')->setColumnLimit(60)->setDefaultValue('')->setColumnComment('密码');
    $table->colTinyInt('is_check')->setIsUnsigned()->setDefaultValue(0)->setColumnComment('登陆状态[0.尚未开放；1.正常；2.禁用]');
    $table->colTinyInt('kick_out')->setIsUnsigned()->setDefaultValue(2)->setColumnComment('是否踢出登录[0：表示在线；1：踢出登录；2.未登录]');
    $table->colInt('use_role', 10)->setIsUnsigned()->setDefaultValue(0)->setColumnComment('正在使用的角色Id');
    $table->colTinyInt('is_delete')->setIsUnsigned()->setDefaultValue(0)->setColumnComment('是否删除[0：否；1：是]');
    $table->indexNormal('is_check', 'is_check');//设置索引
    $table->indexNormal('is_delete', 'is_delete');//设置索引
});